package com.wangba.service;

import com.wangba.dao.UserMapper;
import com.wangba.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service//需要注解声明Service层
public class UserServiceImpl implements UserService {
    //调用UserMapper.login方法验证
    @Autowired
    private UserMapper um;

    public User Validate(String username, String password) {
        User user = um.login(username, password);
        if (user != null) {
            return user;
        }
        return null;
    }

}
